<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .contain{
            width:600px;
            margin:0 auto;
        }
    </style>
</head>
<body>
<div class="contain">
    <div class="form1">
        <div class="block-search">
            <div class="block-search-box">
                <div class="content-select">
                    <div class="now" data-index="1"><span>PC</span><em></em></div>
                    <ul class="list">
                        <li data-index="1">
                            PC
                        </li>
                        <li data-index="2">
                            安卓
                        </li>
                        <li data-index="3">
                            IOS
                        </li>
                        <li data-index="4">
                            专题
                        </li>
                        <li data-index="5">
                            教程
                        </li>
                    </ul>
                </div>
                <div class="content-input">
                    <input type="text" placeholder="请输入搜索关键词">
                </div>
                <div class="content-button">
                    <input type="button" value="搜索" id="content-button">
                </div>
            </div>
            <div class="block-hotsearch">
                热搜 ：<a href="#">无线共享</a><a href="#">VPN链接</a><a href="#">爱奇艺</a>
                <span class="sc">Ctrl + D 收藏</span>
            </div>
        </div>
    </div>
    <div class="form2">
        <div class="block-search">
            <div class="block-search-box">
                <div class="content-input">
                    <input type="text" placeholder="请输入搜索关键词">
                </div>
                <div class="content-button">
                    <input type="button" value="搜索">
                </div>
            </div>
            <div class="block-hotsearch">
                热搜 ：<a href="#">无线共享</a><a href="#">VPN链接</a><a href="#">爱奇艺</a>
            </div>
        </div>
    </div>



</div>





<script src="../../src/federal/js/vendors/jquery-1.10.2/jquery.js"></script>
<script>

    $(function(){
        //搜索
        $(".content-select").mouseover(function () {
            $(".content-select .list").css("display","block");
        });
        $(".content-select").mouseleave(function () {
            $(".content-select .list").css("display","none");
        });
        $(".content-select .list li").on('click',function () {
            $(".content-select .now").attr('data-index',$(this).attr('data-index'));
            $(".content-select .now span").html($(this).html());
            $(".content-select .list").css("display","none");
        });

        $("#content-button").on('click',function () {
            var keyword=$('.content-input input').val().trim();
            var index = $(".content-select .now").attr('data-index');
            var pcurl=""+search_url+"/search/soft/index.php?key="+keyword+"&class=pc";
            var azurl=""+search_url+"/search/soft/index.php?key="+keyword+"&class=az";
            var iosurl=""+search_url+"/search/soft/index.php?key="+keyword+"&class=ios";
            var zturl=""+search_url+"/search/zt/index.php?key="+keyword+"";
            var newsurl = ""+search_url+"/search/news/index.php?key="+keyword+"";
            if(keyword!=""){
                if(index == 1){
                    window.open(pcurl);
                }else if(index == 2){
                    window.open(azurl);
                }else if(index == 3){
                    window.open(iosurl);
                }else if(index == 4){
                    window.open(zturl);
                }else if(index == 5){
                    window.open(newsurl);
                }
            }else{
                alert('请输入搜索关键词');
                return;
            }
        })
    })












</script>
















</body>
</html>